package edu.whu.puppygo.security;

import edu.whu.puppygo.util.GlobalUser;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author guanruwang
 * @date 2023/11/13$
 */
@Component
public class JwtInterceptor implements HandlerInterceptor {
    @Override
    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable Exception ex) throws Exception {
        //得到当前线程持有的user
        GlobalUser.clear();
    }

}
